
    <div class="box-body" style="display: block;">
        <form action="/xqc/delivery/review-upload" method="POST" class="form-horizontal" enctype="multipart/form-data" id="reviewForm">
            <div class="box-body fields-group">

                <div class="form-group">
                    <label class="col-sm-3 control-label"></label>
                    <div class="col-sm-5">
                        <label style="padding-top: 8px;" for="is_fnsku" class="col-sm-3 control-label">平台<span style="color: red">*</span></label>
                        <div class="col-sm-8">
                            <select id="plat_id" name="plat_id" required>
                                {{ getOptions(\App\Models\Basics\SysPlat::$_platformNormal, \App\Models\Basics\SysPlat::PLAT_AMAZON) }}
                            </select>
                            <span class="help-block"><i class="fa fa-info-circle"></i>&nbsp;默认平台为：Amazon</span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label"></label>
                    <div class="col-sm-5">
                        <label style="padding-top: 8px;" for="type" class="col-sm-3 control-label">类型<span style="color: red">*</span></label>
                        <div class="col-sm-8">
                            <select id="type" name="type" required>
                                {{ getOptions(\App\Models\Delivery\DeliveryReview::$_type) }}
                            </select>
                            <span class="help-block"><i class="fa fa-info-circle"></i>&nbsp;选择类型，关联对应模板</span>
                        </div>
                    </div>
                </div>

                <br>
                <div id="template-url"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label"></label>
                    <div class="col-sm-5">
                        <label style="padding-top: 8px;" class="col-sm-3 control-label">上传文件<span style="color: red">*</span></label>
                        <div class="col-sm-8">
                            <input type="file" id="file" style="margin-top: 5px;" name="source_file" accept=".xlsx,.xls" required>
                            <span class="help-block"><i class="fa fa-info-circle"></i>&nbsp;文件后缀为.xlsx或.xls</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10" style="margin-left: 25%">
                        <span style="color:red;">
                            <span style="color:red;">
                            <div>FBA文件命名格式：国家+账号+发货渠道+时间（例：DE+ZH23+空运+221027.xlsx）</div>
                            <div>海外仓文件命名格式：国家+账号+海外仓名称+时间（例：DE+ZH23+互邮+221027.xlsx）</div>
                        </span>
                        </span>
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <div class="col-md-3"></div>
                <div class="col-md-5" style="text-align: center;">
                    <div class="btn-group">
                        {{ csrf_field() }}
                        <button type="submit" class="btn btn-info">提交</button>
                        {{--<button type="button" class="btn btn-info" id="submit-btn">提交</button>--}}
                    </div>
                </div>
            </div>
        </form>
    </div>

    <!--fba template-->
    <template id="review-template-fba">
        <div class="form-group">
            <label class="col-sm-3 control-label"></label>
            <div class="col-sm-5">
                <label style="padding-top: 8px;" for="download" class="col-sm-3 control-label">下载模版</label>
                <div class="col-sm-8">
                    <a class="btn btn-sm btn-info" target="_blank"
                       href="{{ url("xqc/delivery/review-template?temp=DELIVERY_REVIEW_FBA") }}">
                        <i class="fa fa-download"></i>&nbsp;&nbsp;下载FBA模版</a>
                </div>
            </div>
        </div>
        <br>
    </template>

    <!--os template-->
    <template id="review-template-os">
        <div class="form-group">
            <label class="col-sm-3 control-label"></label>
            <div class="col-sm-5">
                <label style="padding-top: 8px;" for="download" class="col-sm-3 control-label">下载模版</label>
                <div class="col-sm-8">
                    <a class="btn btn-sm btn-info" target="_blank"
                       href="{{ url("xqc/delivery/review-template?temp=DELIVERY_REVIEW_WAREHOUSE") }}">
                        <i class="fa fa-download"></i>&nbsp;&nbsp;下载海外仓模版</a>
                </div>
            </div>
        </div>
        <br>

        <div class="form-group">
            <label class="col-sm-3 control-label"></label>
            <div class="col-sm-5">
                <label style="padding-top: 8px;" for="is_fnsku" class="col-sm-3 control-label">是否标贴<span style="color: red">*</span></label>
                <div class="col-sm-8">
                    <select id="is_fnsku" name="is_fnsku" required>
                        <option value="1" selected>是</option>
                        <option value="2" >否</option>
                    </select>
                    <span class="help-block"><i class="fa fa-info-circle"></i>&nbsp;选“否”：模版中子ASIN列不需要填</span>
                </div>
            </div>
        </div>
    </template>

    <script language="JavaScript" type="text/javascript">
        $(function () {

            $('#plat_id').select2({placeholder: '平台', allowClear: true, width: '150px'});

            //select切换模板
            $('#type').select2({
               placeholder: '文件类型',
               allowClear: true,
               width: '150px'})
               .on("change", function(event){
                   let typeId = $(event.target).val();
                   if (typeId == 1) {
                       $('#template-url').html($('#review-template-fba').html());
                   }else if (typeId == 2){
                       $('#template-url').html($('#review-template-os').html());
                       $('#is_fnsku').select2({placeholder: '是否标贴', allowClear: true, width: '150px'});
                   }else {
                       $("#template-url").html('');
                   }
               });


        });

    </script>
